package com.example.project.controller;

import com.example.project.model.bo.LotteryBo;
import com.example.project.model.bo.LotteryQueryDataVo;
import com.example.project.service.LotteryExtBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/12/16.
 * Rest控制器
 */
@RestController
public class HeadRestController {
    @Autowired
    LotteryExtBusinessService lotteryExtBusinessService;
    /**
     * 查询最新10期的下拉框
     * @return
     */
    @RequestMapping(value = { "/downlist"}, method ={ RequestMethod.GET, RequestMethod.POST})
    public LotteryQueryDataVo index() {
        LotteryQueryDataVo lotteryQueryDataVo= lotteryExtBusinessService.loadLotteryDownList();
        return lotteryQueryDataVo;
    }


    /**
     * 查询最新10期的下拉框
     * @return
     */
    @RequestMapping(value = { "/getData"}, method ={ RequestMethod.GET, RequestMethod.POST})
    public LotteryBo getData(long number) {
        LotteryBo lotteryBo= lotteryExtBusinessService.loadLotteryBo(number);
        return lotteryBo;
    }


}
